#include "systemFun.h"
#include <drivers/rtc.h>

void sys_reboot(void)
{
	rt_hw_cpu_reset();
}


rt_time_t system_date_get(void)
{
	rt_device_t device;
	rt_time_t   time = 0;
	
	device = rt_device_find("rtc");
	if (device != RT_NULL)
	{
		 /* get realtime seconds */
		 rt_device_control(device, RT_DEVICE_CTRL_RTC_GET_TIME, &time);
	}
	return time;
}

void system_date_set(rt_time_t time)
{
	rt_device_t device;
	
	device = rt_device_find("rtc");
	if (device != RT_NULL)
	{
		 /* get realtime seconds */
		 rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_TIME, &time);
	}
}
